/**
 * User: Paulo Fournier
 * Date: 12-08-2013
 * Mobile data model
 */

Ext.define('Mobile-app.model.Mobile', {
    extend: 'Ext.data.Model',

    config: {
        autoLoad: false,
        fields: [
            //vehiclesForUserId
            {name: 'id',                type: 'int',    filterable: true},
            {name: 'vehicleIcon',       type: 'int'},
            {name: 'reference',         type: 'string', filterable: true},
            {name: 'carPlate',          type: 'string'},
            {name: 'tagGroup',          type: 'string', filterable: true},
            {name: 'tagUser',           type: 'string', filterable: true},
            {name: 'local',             type: 'string', filterable: true},
            {name: 'speed',             type: 'float'},
            {name: 'route',             type: 'float'},
            {name: 'loadTemperature'}, //object (array)
            {name: 'longitude',         type: 'float'},
            {name: 'latitude',          type: 'float'},
            {name: 'timestamp',         type: 'int'},
            //vehicleDetail
            {name: 'brand',             type: 'string', filterable: true},
            {name: 'model',             type: 'string', filterable: true},
            {name: 'firmware',          type: 'string'},
            {name: 'serialNumber',      type: 'string'},
            {name: 'odometer',          type: 'float'},
            {name: 'fuelConsumption',   type: 'float'},
            {name: 'fuelLevel',         type: 'float'},
            {name: 'tollOk',            type: 'float'},
            {name: 'tollNok',           type: 'float'},
            {name: 'relatedEvents'} //object (array)

        ],
        proxy: {
            type: 'ajax',
            url: 'app/php/public/mobile.request.php',
            reader: {
                type: 'json'
            }
        }
    }

})